This makes no sense at all. I went through my code 4 times over and I don't see a single problem. It's causing windows menu functions to not be recognized and I don't see anything wrong. The problem seems to originate in the "stdafx.c" file which is the first include and there aren't any braces used here at all! Here's my set up:
In the root file at the very top before anything (except comments at the top):
In stdafx.h (ignoring the comments at the top):Code:#include "stdafx.h" #include "My program.h" #include <stdio.h> #include <math.h> #include <string.h> #include "Menus.c"
When I compile just the above, I get this errorCode:#define _CRT_SECURE_NO_DEPRECATE #pragma once #define degrees 0.017453292519943295769236907684886 // multiply by this to convert angles in degrees to radians // Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corresponding values for different platforms. #ifndef WINVER // Allow use of features specific to Windows XP or later. #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. #endif #ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. #define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. #endif #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include <windows.h> // C RunTime Header Files #include <stdlib.h> #include <malloc.h> #include <memory.h> #include <tchar.h> // TODO: reference additional headers your program requires here // common windows-related stuff HWND WindowHandle; // window handle WNDCLASSEX WindowClass; // for a window class MSG msg; // a message for windows int ProgramRunning = 1; // the program is running by default // string stuff char TextString[2048]; // a string for text to use // Debug-related things char DebugDetails[512]; // string for indicating errors double DebugTest[25]; // for displaying values int DebugPointerTest[5]; // general variables char WarningString[512]; // used to display warnings and errors // other things FILE *FileHandle; // handle for reading/writing files
c:\my documents\my programs\My program\My program\stdafx.h(61) : error C2143: syntax error : missing '{' before '*'
It's causing practically every definition to be an error and it makes no sense. If I add the "{" at the top, the errors go away and windows functions are being recognized, but I get a fatal error stating of the end of the file being unexpectedly reached. How I can be getting this error in the very first include where there aren't any braces used at all?